<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<?php
$this->load->view('admin/public_header');
?>
<style>
    .ck-content {
        min-height: 400px;
    }
</style>
<div id="middle">
    <?php
    $this->load->view('admin/public_menu');
    ?>
    <div class="right"  id="mainFrame">
        <div class="right_cont">
            <ul class="breadcrumb">
                <?php echo $breadcrumb;?>
            </ul>

            <div class="title_right">
                <strong>修改主题</strong>
            </div>
            <form action="<?php echo site_url('admin/forum/thread/index/edit');?>" enctype="multipart/form-data" method="post" id="pageForm" target="postIframe">
            	<input type="hidden" value="<?php echo $info['id'];?>" name="id" />
                <table class="table table-bordered" id="base_info">
                    <tr>
                        <td width="80" align="right" bgcolor="#f1f1f1">主题: </td>
                        <td width="750" colspan="3">
                            <input type="text" name="subject" id="name"  value="<?php echo $info['subject'];?>" />[*]
                        </td>
                    </tr>
                    <tr>
                        <td width="80" align="right" bgcolor="#f1f1f1">标签: </td>
                        <td width="750" colspan="3">
                            <input type="text" name="tag" id="tag"  value="<?php echo $tags;?>" />
                        </td>
                    </tr>
                    <tr>
                        <td width="80" align="right" bgcolor="#f1f1f1">所属版块: </td>
                        <td width="750" colspan="3">
                            <select name="forum_id">
                            	<option value="0">--选择版块--</option>
                                <?php foreach($forums as $key=>$val):?>
                            	<option value="<?php echo $val['id'];?>"<?php if($val['id']==$info['forum_id']):?> selected="selected"<?php endif;?>><?php echo $val['name'];?></option>
                            	<?php endforeach;?>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td width="80" align="right" bgcolor="#f1f1f1">内容: </td>
                        <td width="750" colspan="3">

                            <textarea name="content" id="editor"><?php echo $info['content'];?></textarea>
                        </td>
                    </tr>
                </table>
                <table  class="margin-bottom-20  table no-border" >
                    <tr>
                        <td>
                        <input type="button" value="修改" class="btn btn-info" style="width:80px;" onclick="$('#pageForm').submit();" />
                        <input type="button" value="返回" class="btn btn-info" onclick="window.history.go(-1)" style="width:80px;" />
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>

</div>
<script src="/js/ckeditor.js"></script>
<script>
    var data;
    ClassicEditor.create(document.querySelector('#editor'), {
            ckfinder: {
                uploadUrl: '/common/editor_upload'
            }
        }
    ).then(editor => {
        //window.editor = editor;
        //data = editor.getData();
        console.log(data);
    } )
        .catch(error => {
            console.log(error);
        } );
</script>
<iframe src="" height="0" width="0" style="display:none;" id="postIframe" name="postIframe"></iframe>
<?php
$this->load->view('admin/public_footer');
?>
